package de.hft_stuttgart.dsa.ctt.model;

/**
 * This is a mapping class between a {@link CourseAssignmentMatrix} and the
 * fitness value.
 * 
 * @author Eduard Tudenhoefner
 */
public class FitnessToMatrix implements Comparable<FitnessToMatrix> {

	private Integer fitnessValue;
	private AbstractMatrix matrix;

	/**
	 * @param fitnessValue
	 * @param matrix
	 */
	public FitnessToMatrix(Integer fitnessValue, AbstractMatrix matrix) {
		super();
		if (null == fitnessValue || null == matrix) {
			throw new RuntimeException("The fitness value or the matrix must not be null.");
		}

		this.fitnessValue = fitnessValue;
		this.matrix = matrix;
	}

	public Integer getFitnessValue() {
		return fitnessValue;
	}

	public void setFitnessValue(Integer fitnessValue) {
		this.fitnessValue = fitnessValue;
	}

	public AbstractMatrix getMatrix() {
		return matrix;
	}

	public void setMatrix(AbstractMatrix matrix) {
		this.matrix = matrix;
	}

	@Override
	public int compareTo(FitnessToMatrix other) {
		return this.fitnessValue.intValue() - other.fitnessValue.intValue();
	}

}
